package cn.edu.thu.laud.auth;

import java.util.Map;

import org.apache.cassandra.auth.AuthenticatedUser;
import org.apache.cassandra.auth.IAuthenticator;
import org.apache.cassandra.config.ConfigurationException;
import org.apache.cassandra.thrift.AuthenticationException;

public class AllowAllAuthenticator extends MemoryAuthenticator implements IAuthenticator {

	  private final static AuthenticatedUser USER = new AuthenticatedUser("allow_all");

	    public AuthenticatedUser defaultUser()
	    {
	        return USER;
	    }

	    public AuthenticatedUser authenticate(Map<? extends CharSequence,? extends CharSequence> credentials) throws AuthenticationException
	    {
	        return USER;
	    }
	    
	    public void validateConfiguration() throws ConfigurationException
	    {
	        // pass
	    }

}
